package cn.wolfcode.enums;

import lombok.Getter;

/**
 * @Author chenhui
 * @Date 2021/1/14 10:58
 **/
@Getter

public enum  AppointmentStatusEnum {

    PEND("待确认",0),
    PERFORM("履行中",1),
    CONSUME("消费中",2),
    FINISH("归档",3),
    FAILURE("废弃",4);

    private String name;
    private Integer value;

    AppointmentStatusEnum(String name,Integer value){
        this.name = name;
        this.value = value;
    }

    public static String findName(Integer value){
        //获取所有示例
        AppointmentStatusEnum[] enums = values();
        for (AppointmentStatusEnum anEnum :  enums) {
            //判断实例中的value是否等于传入的value
            if(anEnum.value.equals(value)){
                return anEnum.name;
            }
        }
        return null;
    }

}
